import { uploadType, regularRule } from '@/utils/util'
const stateDicData = [
	{ label: '未完成', value: '0', type: 'danger' },
	{ label: '进行中', value: '1', type: 'info' },
	{ label: '已完成', value: '2', type: 'success' },
]
// 家庭床位签约
export const signedFormConfig: any = {
	inline: false,
	labelPosition: 'left',
	labelWidth: '180px',
	showBtn: true,
	column: [
		// 家庭床位签约
		{
			type: 'DividerHtml',
			custome: 'divider',
			position: 'center',
			modelValue: '家庭床位签约',
			span: 24,
		},
		{
			type: 'DividerHtml',
			modelValue: '家庭床位签约',
			span: 24,
		},
		{
			label: '签约机构名名称',
			prop: 'orgName',
			type: 'text',
			maxlength: '50',
			showWordLimit: true,
			span: 12,
			rules: [{ required: true, message: '请输入签约机构名名称' }],
		},
		{
			label: '签约机构统一信用代码',
			prop: 'creditCode',
			type: 'text',
			maxlength: '50',
			showWordLimit: true,
			span: 12,
			rules: [
				{ required: true, message: '请输入签约机构名名称' },
				{ pattern: regularRule.code, message: '请输入正确签约机构统一信用代码' },
			],
		},
		{
			label: '签约时间',
			prop: 'signedTime',
			type: 'datetime',
			format: 'YYYY年MM月DD日 HH时mm分ss秒',
			valueFormat: 'YYYY-MM-DD HH:mm:ss',
			span: 12,
			rules: [{ required: true, message: '请输入签约时间' }],
		},
		{
			label: '签约时长（天）',
			prop: 'signedDuration',
			type: 'text',
			append: '天',
			rules: [
				{ required: true, message: '请输入签约时长' },
				{ validator: regularRule.number, message: '请输入正确的签约时长' },
			],
			span: 12,
		},
		{
			label: '签约价格（元）',
			prop: 'signedPrice',
			type: 'text',
			append: '元',
			rules: [
				{ required: true, message: '请输入签约价格' },
				{ validator: regularRule.number, message: '请输入正确的签约价格' },
			],
			span: 12,
		},
		{
			label: '签约材料',
			prop: 'signedMaterials',
			type: 'upload',
			fileType: uploadType.fileMetaType,
			listType: 'text',
			labelPosition: 'left',
			showFileList: true,
			changeField: true,
			limit: 1,
			multiple: true,
			span: 12,
			rules: [{ required: true, message: '请输入签约材料' }],
		},
		{
			label: '签约档案状态',
			prop: 'signState',
			propName: 'signStateLabel',
			type: 'select',
			dicData: stateDicData,
			filterKey: 'value',
			multiple: false,
			span: 12,
			rules: [{ required: true, message: '请输入签约档案状态' }],
		},
	],
}
